// let a1 = [1, 2]
// let a2 = [3, 4]

// let a3 = a1.concat(a2)

// let obj = {
//     name: 'tom',
//     age: 18
// }

// const res = structuredClone(obj)


function deepClone(obj) {
    return new Promise((resolve, reject) => {
        const { port1, port2 } = new MessageChannel()
        port1.postMessage(obj)
        port2.onmessage = (ev) => {
            resolve(ev.data)
        }
    })
}